﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="member-list.aspx.cs" Inherits="Automobile.service.UI.member_list" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>

<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,member-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
    <link href="css/H-ui.min.css" rel="stylesheet" type="text/css" />
    <link href="css/H-ui.admin.css" rel="stylesheet" type="text/css" />
    <link href="lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
    <!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
    <title>会员管理</title>
</head>
<body>
    <form runat="server">
        <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 会员销售 <span class="c-gray en">&gt;</span> 会员管理 <a class="btn btn-success radius r mr-20" style="line-height: 1.6em; margin-top: 3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a></nav>
        <div class="pd-20">
            <div class="text-c">
                日期范围：
		<input type="text" runat="server" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'datemax\')||\'%y-%M-%d\'}'})" id="datemin" class="input-text Wdate" style="width: 120px;">
                -
		<input type="text" runat="server"  onfocus="WdatePicker({minDate:'#F{$dp.$D(\'datemin\')}',maxDate:'%y-%M-%d'})" id="datemax" class="input-text Wdate" style="width: 120px;">
                <input type="text" class="input-text" style="width: 250px" runat="server" placeholder="输入会员名称" id="MemberCard_owner">
                <button type="submit" class="btn btn-success radius" runat="server" onserverclick="Unnamed_ServerClick"><i class="Hui-iconfont">&#xe665;</i> 搜用户</button>
            </div>
            <div class="cl pd-5 bg-1 bk-gray mt-20"><span class="l"><a href="javascript:;" onclick="datadel()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a> <a href="javascript:;" onclick="member_add('添加会员','Supplier_Add.aspx','','510')" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i> 添加会员</a></span> <span class="r">共有数据：<strong><asp:Label runat="server" ID="Label" ></asp:Label></strong> 条</span> </div>

            <div class="mt-20">
                <asp:Repeater ID="Repeater1" runat="server" OnItemCommand="Repeater1_ItemCommand">
                    <HeaderTemplate>
                        <table class="table table-border table-bordered table-hover table-bg table-sort">
                    <thead>
                        <tr class="text-c">
                            <th width="25">
                                <input type="checkbox" name="" value=""></th>
                            <th width="80">会员编号</th>
                            <th width="100">会员卡号</th>
                            <th width="80">车主姓名</th>
                            <th width="90">车牌号码</th>
                            <th width="150">车辆品牌</th>
                            <th width="100">会员积分</th>
                            <th width="">储值金额</th>
                            <th width="70">会员等级</th>
                            <th width="150">加入时间</th>
                            <th width="70">会员状态</th>
                            <th width="100">操作</th>
                        </tr>
                    </thead>
                    </HeaderTemplate>
                    <ItemTemplate>
                         <tbody>
                            <tr class="text-c">
                                <td>
                                    <input type="checkbox" value="<%#Eval("MemberCard_Id")%>" name="id"></td>
                                <td><%#Eval("MemberCard_Id")%></td>
                                <td><u style="cursor: pointer" class="text-primary" onclick="member_show('张三','member-show.html','10001','360','400')"><%#Eval("MemberCard_Name")%></u></td>
                                <td><%#Eval("MemberCard_owner")%></td>
                                <td><%#Eval("MemberCard_Cnum")%></td>
                                <td><%#Eval("MemberCard_CardID")%></td>
                                <td class="text-l"><%#Eval("MemberCard_ingeral")%></td>
                                <td><%#Eval("MemberCard_sphere")%></td>
                                <td><%#Eval("MemberCardRank_Rank")%></td>
                                <td><%#Eval("MemberCard_Adddate")%></td>
                                <td><a class="label label-success radius" id="state" onclick="UptState(<%#Eval("MemberCard_Id") %>)"><%#Convert.ToInt32(Eval("MemberCard_State"))==0?"已开启":"已禁止"%></a></td>
                                <td>
                                    <asp:Button ID="Button1" runat="server" Text="删除" CommandName="del" CommandArgument='<%#Eval("MemberCard_Id") %>' OnClientClick ="return confirm('确定要删除吗？')" class="btn btn-primary radius"/>
                                    <a href="javascript:;" onclick="member_upd('添加会员','mem-alter.aspx?mid='+'<%#Eval("MemberCard_Id") %>','','510')" class="btn btn-primary radius">修改</a>
                                </td>
                            </tr>
                        </tbody>
                    </ItemTemplate>
                    <FooterTemplate>
                        </table>
                    </FooterTemplate>
                </asp:Repeater>
                
            </div>
            <div style="height:100px; width:400px">
                
                <webdiyer:AspNetPager ID="AspNetPager1" runat="server" OnPageChanged="Unnamed1_PageChanged"></webdiyer:AspNetPager>
                </div>

        </div>
        <script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
        <script type="text/javascript" src="lib/layer/1.9.3/layer.js"></script>
        <script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
        <script type="text/javascript" src="lib/My97DatePicker/WdatePicker.js"></script>
        <script type="text/javascript" src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
        <script type="text/javascript" src="js/H-ui.js"></script>
        <script type="text/javascript" src="js/H-ui.admin.js"></script>
        <script type="text/javascript">
            /*用户-添加*/
            function member_add(title, url, w, h) {
                layer_show(title, url, w, h);
            }
            /*用户-查看*/
            function member_upd(title, url, id, w, h) {
                layer_show(title, url, w, h);
            }

            function datadel()
            {
                if ($(":checkbox[name='id']:checked").length <= 0)
                {
                    alert("至少选择一项");
                    return false;
                } 
                var str = "";
                $(":checkbox[name='id']:checked").each(function () {
                    str += $(this).val() + ",";
                })
                str = str.substr(0, str.length - 1);
                $.ajax({
                    type: "post",
                    url: "Hander/Handler1.ashx?url="+"delMem",
                    data: {
                        str: str
                    },
                    success: function (data) {
                        if (data > 0) {
                            alert("删除成功！");
                            location.reload();
                        }
                        else {
                            alert("删除失败！");
                        }
                    },
                    error: function () {
                        alert("服务器忙");
                    }
                })
            }
            function UptState(id)
            {
                var MemberCard_State = $("#state").text() == "已开启" ? 1 : 0;

                $.ajax({
                    type: "post",
                    url:"Hander/Handler1.ashx?url=" + "UptState",
                    data: {
                        MemberCard_Id: id,
                        MemberCard_State: MemberCard_State
                    },
                    success: function (data) {
                        if(data>0)
                        {
                            alert("修改成功");
                            location.reload();
                        }
                    },
                    error:function(){
                        alert("服务器忙");
                    }
                    
                })
            }
        </script>
    </form>
</body>
</html>
